# -*- coding: utf-8 -*-
"""
@File: serializers.py.py
@author: chenxialin
@time: 4月 08, 2025 10:18
"""
from rest_framework import serializers
from .models import Announcement, Book, BorrowRecord


class AnnouncementSerializer(serializers.ModelSerializer):
    class Meta:
        model = Announcement
        fields = '__all__'  # 包含所有字段


class BookSerializer(serializers.ModelSerializer):
    class Meta:
        model = Book
        fields = '__all__'


class BorrowRecordSerializer(serializers.ModelSerializer):
    class Meta:
        model = BorrowRecord
        fields = ['id', 'user', 'book', 'borrow_date', 'return_date']